{extend name="admin@public/base_content" /}
{block name="body">}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                {include file="admin@public/common" /}
                <div class="widget-body  am-fr">
                    <div class="am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                            <thead>
                            <tr>
                                <th class="table-id">ID</th>
                                <th>名称</th>
                                <th>表名</th>
                                <th>状态</th>
                                <th width="176px" style="text-align:center">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {foreach name="list" item="vo"}
                            <tr class="gradeX">
                                <td>{$vo.fieldset_id}</td>
                                <td>{$vo.name}</td>
                                <td>{$vo.table}</td>
                                <td>
                                    {if condition="$vo.status eq 1"}
                                    <i class="am-icon-check am-text-warning"></i>
                                    {else /}
                                    <i class="am-icon-close am-text-primary"></i>
                                    {/if}
                                </td>
                                <td>
                                    <div class="tpl-table-black-operation">
                                        <a href="{:url('AdminExpandField/index',array('fieldset_id'=>$vo['fieldset_id']))}">
                                            <i class="am-icon-th"></i> 管理
                                        </a>
                                        <a href="{:url('edit',array('fieldset_id'=>$vo['fieldset_id']))}">
                                            <i class="am-icon-pencil"></i> 编辑
                                        </a>
                                        <a href="javascript:;" class="tpl-table-black-operation-del" onclick="del(this,'{$vo.fieldset_id}','{:url(\'del\')}')" >
                                            <i class="am-icon-trash"></i> 删除
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            {/foreach}
                            <!-- more data -->
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    /**
     * 删除操作
     */
    function del(obj,id,url) {
        //此处请求后台程序，下方是成功后的前台处理……
        if(confirm("确定要删除吗？")) {
            $.post(url, {
                id: id,
            }, function (data) {
                //console.log(data);
                if (data.code == 1) {
                    $(obj).parents("tr").remove();
                } else {
                    di_alert(data.msg,2);
                }
            })
        }
    }
</script>
{/block}